#ifndef AXIL_CMD_H
#define AXIL_CMD_H

#define OFFSET_AXIL_SET_MODE            0x00    //  mode set  00: idle  01: video 02 photo
#define OFFSET_AXIL_SET_TRIGGER         0x04    //  trigger set  signal must set 0 after 1 at least from 1us to 10us
#define OFFSET_AXIL_SET_STOP            0x08    //  when in long long exp, want to stop exp. signal must set 0 after 1 at least from 1us to 10us
#define OFFSET_AXIL_SET_EXP             0x0C    //  exp time  high 24bit is exp0_c and low 8bit is exp0_f
#define OFFSET_AXIL_SET_U_LENGTH        0x10    //  u_length low 16bit is valid
#define OFFSET_AXIL_SET_ROWS            0x14    //  image output rows low 16bit is valid

#define OFFSET_AXIL_GET_STATUS          0x00    //can get status,
                                                //localparam s_idle 		    = 4'd0;//idle

                                                //localparam s_exp_video 		= 4'd1;//exp
                                                //localparam s_exp_photo 		= 4'd2;

                                                //localparam s_gen_gap_video 	= 4'd4;//gap
                                                //localparam s_gen_gap_photo 	= 4'd7;

typedef struct {
    unsigned int baseAddr;
    int axil_cmd_handler;
    unsigned int* axil_cmd_VirtualAddress;
} axil_cmd_handle;

int axil_cmd_setup(axil_cmd_handle *handle, unsigned int baseAddr);
void axil_cmd_set(axil_cmd_handle *handle, int num, unsigned int val);
unsigned int axil_cmd_get(axil_cmd_handle *handle, int num);

#endif // AXIL_CMD_H
